import React, { Component } from 'react'

class Top extends Component {
    render() { 
        let { list, clickBtn, i } = this.props
        return (
            <div>
                <ul>
                {
                    list && list.length ? list.map((item, index) => {
                        return <li key={index} className={i===index ? 'active' : ''} onClick={() => {
                            clickBtn(index)
                        }}>
                            {item.title}
                        </li>
                    }) : <div>暂无数据</div>
                }
                </ul>
            </div>
        )
    }
}
 
export default Top